<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
	<meta name="language" content="EN" scheme="DCTERMS.RFC3066" />
	<meta name="creator" content="Felix Nagel, http://www.felixnagel.com for Namics (Deutschland) GmbH, http://www.namics.com" />
	<script type="text/javascript">	
		$(function() {			
			var table1 = $("table").ariaSorTable({
				rowsToShow: 10,
				pager: true,
				onInit: function() {
					demoControl();
				},
				colsToHide: {
					1: true,
					7: true
				}
			});
			$("#destroy").click(function (event) { 
				table1.ariaSorTable('destroy');
			});		
			$("#disable").click(function (event) { 
				table1.ariaSorTable('disable');
			});			
			
			// add themeswitcher
			var ts = $('<div class="ui-button ui-widget ui-state-default ui-corner-all" style="font-size: 0.7em; padding: 5px; position: absolute; top: 20px; right: 10px;">Click here to add Themeswitcher!</div>')
			.appendTo('body')
			.bind("click", function() {
				ts.text("Loading Themeswitcher...");
				$.getScript('http://ui.jquery.com/applications/themeroller/themeswitchertool/', function() {
					ts.removeClass("ui-button ui-widget ui-state-default ui-corner-all").text("").unbind("click").themeswitcher(); 
				});
			}); 
		});		
	</script>
		
	<link href="${initParam.root}/css/style.css" rel="stylesheet" />
	<table>
			<thead>
				<tr>
					<th class="ui-table-asc ui-state-active ui-table-number ui-state-default" style="min-width: 4.2em;"><a href="#server_site_order">NO</a></th>
					<th class="ui-table-number ui-state-default" style="min-width: 10em;"><a href="#server_site_order">123123</a></th>
					<th class="ui-table-number ui-state-default" style="min-width: 10em;"><a href="#server_site_order">Category</a></th>
					<th class="ui-table-number-de ui-state-default" style="min-width: 10em;">Title</th>
					<th class="ui-table-number ui-state-default" style="min-width: 6em;"><a href="#server_site_order">작성자</a></th>
					<th class="ui-table-date-de ui-state-default" style="min-width: 8em;"><a href="#server_site_order">Date</a></th>
					<th class="ui-table-date-iso ui-state-default" style="min-width: 8em;"><a href="#server_site_order">조회수</a></th>
					<th class="ui-table-text ui-state-default" style="min-width: 10em;"><a href="#server_site_order">String</a></th>
				</tr>
			</thead>
			<tbody>
				<c:forEach items="${requestScope.ttlist }" var="ttlist">
				<tr>
				<!-- no,title, content, writdate, count, category,id -->
					<td>${ttlist.no }</td>
					<td> </td>
					<td>${ttlist.category }</td>
					
						<c:if test="${sessionScope.mvo!=null}">
							<td>
							<a href="${initParam.root}/findByNo.do?no=${ttlist.no}&count=${ttlist.count}">${ttlist.title }</a>
							</td>
						</c:if>
						<c:if test="${sessionScope.mvo==null}">
							<td>${ttlist.title }</td>
						</c:if>
					
					<td>${ttlist.memberVO.id }</td>
					<td>${ttlist.writedate }</td>
					<td>${ttlist.count }</td>
				</tr>
				</c:forEach>
			</tbody>
		</table>
	
    
 <table width="300" height="10">
 <tr>
 <td>
 <form method="get" action="insertTtBoardView.do">
<c:if test="${sessionScope.mvo!=null}">
<input type="submit" value="글쓰기" id="writeBtn">
</c:if>
</form>
 </td>
 <td>
 <form method="get" action="find.do">
<select id="kind" name="kind">
	<option>---</option>
	<option value="id">아이디</option>
	<option value="title">제목</option>
	<option value="category">분류</option>
</select>
 </td>
 <td>
 <input type="text" name="find" id="find" >
 </td>
  <td>
<input type="submit" value="검색" id="findForm">
</form>
 </td>
 </tr>
 
 </table>

